/* Copyright (c) 2024 Huawei Technologies Co., Ltd.
openFuyao is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
import BreadCrumbCom from '../components/BreadCrumbCom';
import { containerRouterPrefix } from '../common/constants';
import { Tabs } from 'antd';
import PodPage from '../pages/workload/PodPage';
import DeploymentPage from '../pages/workload/DeploymentPage';
import StatefulSetPage from '../pages/workload/StatefulSetPage';
import DaemonSetPage from '../pages/workload/DaemonSetPage';
import JobPage from '../pages/workload/JobPage';
import CronJobPage from '../pages/workload/CronJobPage';
import { useEffect, useState, useCallback } from 'openinula';
import '../styles/ColocationWorkloadManagementPage.less';

export default function ColocationWorkloadManagementPage() {
  const [helmDetailTabKey, setHelmDetailTabKey] = useState('1');
  const items = [
    {
      key: '1',
      label: 'Pod',
      children: <PodPage />,
    },
    {
      key: '2',
      label: 'Deployment',
      children: <DeploymentPage />,
    },
    {
      key: '3',
      label: 'StatefulSet',
      children: <StatefulSetPage />,
    },
    {
      key: '5',
      label: 'Job',
      children: <JobPage />,
    },
    {
      key: '6',
      label: 'CronJob',
      children: <CronJobPage />,
    },
  ];

  const handleSetHelmDetailTabKey = (key) => {
    setHelmDetailTabKey(key);
  };

  return <div className="child_content">
    <BreadCrumbCom className="create_bread" items={[
      { title: '在离线混部', path: `/ColocationWorkloadManagement` },
      { title: '工作负载管理', path: `/` },
    ]} />
    <Tabs items={items} onChange={handleSetHelmDetailTabKey} activeKey={helmDetailTabKey} destroyInactiveTabPane={true}></Tabs>
  </div >;
}